/**
 * 首页
 * 
 */
/* eslint  react/prop-types:0*/
import React, { Component } from 'react'
import PropTypes from 'prop-types'
import { Grid, Button, WingBlank, WhiteSpace } from 'antd-mobile'
import Navbar from '@components/navbar'
import { Connect } from '@components/store'


@Connect((store) => ({
  config: store.config,
}))
export default class TestStore extends Component {

  constructor(props) {
    super(props)
    this.state = {}
    this.appData = [
      {
        text: '预售许可证',
        icon: 'resource/image/app.png',
        route: '/app/ysxkz'
      },
    ]
  }

  /**
   * 点击app去对应的路由
   */
  onClick = (e) => {
    if (e.route) {
      this.props.history.push(e.route)
    }
  }

  render() {
    //throw ('我是错误制造器')

    return (
      <div className="app-wrap">
        <Navbar title="应用中心" />
        <div className="app-content">
          <div className="sub-title">功能列表</div>
          <Grid onClick={this.onClick} data={this.appData} columnNum={3} />
        </div>
      </div>
    )
  }
}

TestStore.propTypes = {
  config: PropTypes.object,
}
